#include "Plane.h"

/// <Summary> The collision type of this object </Summary>
const HashString Plane::COLLISIONTYPE("COLLISION_PLANE");

////////////////////////////////////////////////////////////////////////////////////////////////////
/// <Summary>	Transforms this object by a matrix </Summary>
///
/// <Param name="transform">	The transform matrix	</Param>
////////////////////////////////////////////////////////////////////////////////////////////////////
void Plane::Transform(const Matrix4x4& transform)
{
	Vector3 newNormal;
	RotateVector(newNormal, this->normal, transform);
	this->normal = newNormal;
	this->offset += DotProduct(this->normal, transform.WAxis);
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// <Summary>	Prints this object to the console </Summary>
///
/// <Param name="out">	The console window </Param>
///
/// <Return>	The console window </Return>
////////////////////////////////////////////////////////////////////////////////////////////////////
ConsoleWindow& Plane::Print(ConsoleWindow& out) const
{
	return out << "\nPLANE:\n" << "Normal:  " << normal << "\nOffset:  " << offset << "\n";
}